from datetime import datetime

from pydantic import BaseModel, Field


class UserApplySchemas(BaseModel):
    """申请参数"""

    id: int = Field(None, description="申请id")
    name: str = Field(None, description="申请名称")
    type: int = Field(None, description="申请类型")
    status: int = Field(None, description="状态")
    label: str = Field(None, description="标签")
    image: str = Field(None, description="上传图片")
    oa_serial_number: str = Field(None, description="OA单号")
    userApply: dict = Field({}, description="用户申请")

    user_id: int = Field(None, description="申请人id")
    user_name: str = Field(None, description="申请人姓名")
    user_number: str = Field(None, description="申请人工号")
    post_id: int = Field(None, description="岗位id")
    post_name: str = Field(None, description="岗位名称")
    department_id: int = Field(None, description="部门id")
    department_name: int = Field(None, description="部门名称")

    auditor: str = Field(None, description="审核人")
    authorizer: str = Field(None, description="授权人")
    award_deduction_date: datetime = Field(None, description="奖扣日期")
    remark: str = Field(None, description="备注")


class UserApplyDetailSchemas(BaseModel):
    """字典保存"""

    id: int = Field(None, description="详情id")
    apply_id: int = Field(None, description="申请id")

    apply_user_id: str = Field(None, description="申请人id")
    participant_user_id: int = Field(None, description="参与人id")
    participant_user_name: str = Field(None, description="参与人姓名")
    participant_user_number: str = Field(None, description="参与人工号")
    point_level: int = Field(None, description="积分等级")
    award_deduction_type: int = Field(None, description="奖扣类型")
    award_deduction_value: str = Field(None, description="奖扣分")
    creation_date: datetime = Field(None, description="申请时间")
    updation_date: datetime = Field(None, description="修改时间")
